package com.trafficsys.modules.owner.controller;

import com.trafficsys.modules.entity.Ticket;
import com.trafficsys.modules.loginAndRegister.pojo.TicketAndRule;
import com.trafficsys.modules.owner.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;


@Controller
@RequestMapping("/api")
public class PayController {
	//注入阿里支付 业务功能模块
	@Autowired
	private PayService payService;
	/**二维码扫描支付  发送请求到阿里接口 返回阿里支付地址 前端形成二维码
	 *
	 */
	@RequestMapping("/pay")
	@ResponseBody
	public HashMap<String,Object> pay(TicketAndRule ticketAndRule){
		return payService.aliPay(ticketAndRule);
	}
}
